// maxiGos v6.57 > mgosTitle.js

if (typeof mxG.G.prototype.createTitle=='undefined'){

mxG.Z.fr[", "]=", ";

if (!mxG.Z.fr["translateTitle"]) mxG.Z.fr["translateTitle"]=function(ev,ro)
{
	var s=ev+"",a=ro+"",c="",of="",t="",between="";
	if (a!="")
	{
		if (a.search(/^([0-9]+)$/)==0) t="ronde";
		else if (a.search(/[ ]*\((final|semi-final|quarter-final|playoff|game|round)\)/i)>=0)
		{
			if (s.search(/[ ]+(cup|league)/i)>=0) of=" de la ";else if (s) of=" du ";
			if (a.search(/[ ]*\(final\)/i)>=0) {c="Finale"+of;t="partie";}
			else if (a.search(/[ ]*\(semi-final\)/i)>=0) {c="Demi-finale"+of;t="partie";}
			else if (a.search(/[ ]*\(quarter-final\)/i)>=0) {c="Quart de finale"+of;t="partie";}
			else if (a.search(/[ ]*\(playoff\)/i)>=0) {c="Playoff"+of;t="partie";}
			else if (a.search(/[ ]*\(game\)/i)>=0) t="partie";
			else t="tour";
			a=a.replace(/[ ]*\((final|semi-final|quarter-final|playoff|game|round)\)/i,"");
		}
		else if (a.search(/[ ]*\(final tournament\)/i)>=0)
		{
			if (s.search(/[ ]+(cup|league)/i)>=0) of=" de la ";else if (s) of=" du ";
			c="Tournoi final"+of;t="ronde";
			a=a.replace(/[ ]*\(final tournament\)/i,"");
		}
		if (a.search(/^([0-9]+)/)==0) a=a.replace(/^([0-9]+)(.*)/,t+(t?" ":"")+"$1$2");
	}
	if (s.search(/^([0-9]+)(st|nd|rd|th)/i)>=0)
	{
		s=s.replace(/^([0-9]+)(st|nd|rd|th)[ ]+Female[ ]+(.*)$/i,"$1$2 $3 féminin");
		s=s.replace(/^([0-9]+)(st|nd|rd|th)[ ]+(Former|Old)[ ]+(.*)$/i,"$1$2 ancien $4");
		s=s.replace(/^([0-9]+)(st|nd|rd|th)/i,"$1<span class=\"sup\">e</span>");
		s=s.replace(/^1<span class=\"sup\">ème<\/span>/,(s.search(/[ ]+(cup|league)/i)>=0)?"1<span class=\"sup\">re</span>":"1<span class=\"sup\">er</span>");
	}
	s=c+s;
	if (s&&(a.search(/^[a-zA-Z0-9]/)==0)) s+=", ";else if (s&&a) s+=" ";
	if (s) s=s.ucFirst(); else if (a) a=a.ucFirst();
	if (s) s="<span class=\"mxEVTitleSpan\">"+s+"</span>";
	if (a) a="<span class=\"mxROTitleSpan\">"+a+"</span>";
	return s+a;
};

if (!mxG.Z.en["translateTitle"]) mxG.Z.en["translateTitle"]=function(ev,ro)
{
	var s=ev+"",a=ro+"",c="",t="",before="",between="";
	if (a!="")
	{
		if (a.search(/^([0-9]+)$/)==0) t="round";
		if (a.search(/[ ]*\((final|semi-final|quarter-final|playoff|game|round)\)/i)>=0)
		{
			if (s) before=", ";
			if (a.search(/[ ]*\(final\)/i)>=0) {c=before+"final";t="game";}
			else if (a.search(/[ ]*\(semi-final\)/i)>=0) {c=before+"semi-final";t="game";}
			else if (a.search(/[ ]*\(quarter-final\)/i)>=0) {c=before+"quarter-final";t="game";}
			else if (a.search(/[ ]*\(playoff\)/i)>=0) {c=before+"playoff";t="game";}
			else if (a.search(/[ ]*\(game\)/i)>=0) t="game";
			else t="round";
			a=a.replace(/[ ]*\((final|semi-final|quarter-final|playoff|game|round)\)/i,"");
		}
		else if (a.search(/[ ]*\(final tournament\)/i)>=0)
		{
			if (s) before=", ";
			c=before+"final tournament";t="round";
			a=a.replace(/[ ]*\(final tournament\)/i,"");
		}
		if (a.search(/^([0-9]+)/)==0) a=a.replace(/^([0-9]+)(.*)/,t+(t?" ":"")+"$1$2");
	}
	s=s+c;
	if (s&&(a.search(/^\(/)==0)) between=" ";else if (s&&a) between=", ";
	s=s+between+a;
	return s.ucFirst();
};

mxG.G.prototype.buildTitle=function()
{
	var ev,ro,f;
	ev=this.getInfoS("EV");
	ro=this.getInfoS("RO");
	if (this.translateTitleOn) f="translateTitle";else f="buildTitle";
	if (mxG.Z[this.l]&&mxG.Z[this.l][f]) return mxG.Z[this.l][f](ev,ro);
	return ev+((ev&&ro)?this.local(", "):"")+ro;
};

mxG.G.prototype.initTitle=function()
{
	if (this.titleBoxOn)
	{
		var t=this.buildTitle();
		this.title=t;
		this.getE("TitleH1").innerHTML=t;
		if (this.hideEmptyTitle) this.getE("TitleH1").style.visibility=(t?"visible":"hidden");
	}
};

mxG.G.prototype.updateTitle=function()
{
	if (this.titleBoxOn)
	{
		var t=this.buildTitle();
		if (this.title!=t)
		{
			this.getE("TitleH1").innerHTML=t;
			this.title=t;
			if (this.hideEmptyTitle) this.getE("TitleH1").style.visibility=(t?"visible":"hidden");
		}
	}
};

mxG.G.prototype.createTitle=function()
{
	if (this.titleBoxOn) this.write("<h1 class=\"mxTitleH1\" id=\""+this.n+"TitleH1\"></h1>");
};

}